package com.sviet.game.tetriswindow.dialog;

import com.sviet.game.tetriswindow.R;

import android.app.Dialog;
import android.content.Context;
import android.graphics.Color;
import android.graphics.drawable.ColorDrawable;
import android.os.Bundle;
import android.util.Log;
import android.view.View;
import android.view.View.OnClickListener;
import android.view.Window;
import android.widget.Button;

/**
 * @author ThinhNH
 *
 */
public class AboutDialog extends Dialog implements OnClickListener {

	private String TAG = AboutDialog.class.getSimpleName();
	private Context context;
	private Button bt_ok;

	public AboutDialog(Context context) {
		super(context);
		// remove background dialog using style
		// super(context, R.style.Theme_Dialog_Translucent);
		// TODO Auto-generated constructor stub

		Log.v(TAG, "AboutDialog");
		this.context = context;
		Log.v(TAG, "this.context = " + this.context);
	}

	@Override
	protected void onCreate(Bundle savedInstanceState) {
		// TODO Auto-generated method stub
		super.onCreate(savedInstanceState);

		requestWindowFeature(Window.FEATURE_NO_TITLE);
		setContentView(R.layout.about_dialog);

		// remove background dialog
		this.getWindow().setBackgroundDrawable(
				new ColorDrawable(Color.TRANSPARENT));

		// Buttons
		bt_ok = (Button) findViewById(R.id.about_bt_ok);
		bt_ok.setOnClickListener(this);
	}

	@Override
	public void onClick(View v) {
		// TODO Auto-generated method stub
		if (v.getId() == R.id.about_bt_ok) {
			dismiss();
		}
	}
}
